<template>
	<view class="agreement">
		<navbar :config="config"></navbar>
		<view class="top ql-editor-box" v-html="agreement">
			
		</view>
		<!-- <view class="topsbox">
			<view class="richText" >
				<jyf-parser   :html="$mUtil.formatRichText(agreement)" ref="article"></jyf-parser>
			
			</view>
		</view> -->
		
		<!-- <loadMore v-if="balance.length>0" :status="status" ></loadMore> -->
	</view>
</template>

<script>
	import jyfParser from "../../components/jyf-parser/jyf-parser";
	var app = getApp()
	export default {
		components: {
			jyfParser
		},
		data() {
			return {
				config: {
					back: true, //false是tolbar页面 是则不写
					title: '注册协议',
					color: '#1A1A1A',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, "#FFFFFF"],
					statusBarFontColor: '#1A1A1A',
					
				},
				agreement:'',
				balance:[],
				parmas:{
					page:1,
					limit:20,
					title:''
				},
				noData:false,
				tabTop:0,
				status:'more',//more|loading|noMore
				
			}
		},
		
		onLoad(options){
			if(options.type){
				if(options.type==1){
					this.config.title='会员注册协议';
					this.agreementInfo(options.type);
				}
				if(options.type==2){
					this.config.title='商家注册协议';
					this.agreementInfo(options.type);
				}
			}
		},
		methods:{
			agreementInfo(type){
				this.$http.get('/protocol/info')
					.then(res => {
						if(res&&res.code==200){
							if(type==1){
								this.agreement = res.data.user_protocol 
							}else{
								this.agreement = res.data.shop_protocol
							}
						}
					})
			}
		}
	}
</script>

<style scoped lang="scss">
	.agreement {
		width: 100%;
		overflow: hidden;
	}
	
	.topsearch{
		position: fixed;
		left: 0;
		width: 100%;
		z-index: 2;
		box-sizing: border-box;
		background-color: #fff;
	}
	.topsbox{
		padding: 80rpx 30rpx 0;
	}
	.leftbox{
		height: 60rpx;
		line-height: 60rpx;
		background-color: #E6E6E6;
		border-radius: 30rpx;
	}
	.u-p30s{
		padding: 10rpx 30rpx;
	}
	.uptop{
		padding:30rpx 0 ;
		width: 100%;
		position: relative;
	}
	.turn{
		transform:rotate(90deg);
		
	}
	.top{
		padding:0 20rpx;
	}
</style>
